.class public Lcom/netease/newsreader/util/FileUtils;
.super Ljava/lang/Object;
.source "FileUtils.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/netease/newsreader/util/FileUtils$BitmapOfflineDownloaderTask;,
        Lcom/netease/newsreader/util/FileUtils$DownloadThread;
    }
.end annotation


# static fields
.field public static DetailPageTempDir:Ljava/lang/String;

.field public static EXPIRE:J

.field public static FileTempDir:Ljava/lang/String;

.field public static NewsListTempDir:Ljava/lang/String;

.field private static imgSrc:Ljava/lang/StringBuilder;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 23
    const-string v0, "/sdcard/netease/newsreader/netease_temp_file/"

    sput-object v0, Lcom/netease/newsreader/util/FileUtils;->FileTempDir:Ljava/lang/String;

    .line 24
    const-string v0, "/sdcard/netease/newsreader/netease_temp_file/detail_page/"

    sput-object v0, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    .line 25
    const-string v0, "/sdcard/netease/newsreader/netease_temp_file/news_list/"

    sput-object v0, Lcom/netease/newsreader/util/FileUtils;->NewsListTempDir:Ljava/lang/String;

    .line 26
    const-wide/16 v0, 0x2

    sput-wide v0, Lcom/netease/newsreader/util/FileUtils;->EXPIRE:J

    .line 262
    const/4 v0, 0x0

    sput-object v0, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    .line 22
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 22
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static FormetFileSize(J)Ljava/lang/String;
    .locals 7
    .parameter "fileS"

    .prologue
    .line 60
    new-instance v0, Ljava/text/DecimalFormat;

    const-string v2, "#.00"

    invoke-direct {v0, v2}, Ljava/text/DecimalFormat;-><init>(Ljava/lang/String;)V

    .line 61
    .local v0, df:Ljava/text/DecimalFormat;
    const-string v1, ""

    .line 62
    .local v1, fileSizeString:Ljava/lang/String;
    const-wide/16 v2, 0x400

    cmp-long v2, p0, v2

    if-gez v2, :cond_0

    .line 63
    const-string v1, "0K"

    .line 71
    :goto_0
    return-object v1

    .line 64
    :cond_0
    const-wide/32 v2, 0x100000

    cmp-long v2, p0, v2

    if-gez v2, :cond_1

    .line 65
    new-instance v2, Ljava/lang/StringBuilder;

    long-to-double v3, p0

    const-wide/high16 v5, 0x4090

    div-double/2addr v3, v5

    invoke-virtual {v0, v3, v4}, Ljava/text/DecimalFormat;->format(D)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, "K"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    .line 66
    :cond_1
    const-wide/32 v2, 0x40000000

    cmp-long v2, p0, v2

    if-gez v2, :cond_2

    .line 67
    new-instance v2, Ljava/lang/StringBuilder;

    long-to-double v3, p0

    const-wide/high16 v5, 0x4130

    div-double/2addr v3, v5

    invoke-virtual {v0, v3, v4}, Ljava/text/DecimalFormat;->format(D)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, "M"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    .line 69
    :cond_2
    new-instance v2, Ljava/lang/StringBuilder;

    long-to-double v3, p0

    const-wide/high16 v5, 0x41d0

    div-double/2addr v3, v5

    invoke-virtual {v0, v3, v4}, Ljava/text/DecimalFormat;->format(D)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, "G"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    goto :goto_0
.end method

.method static synthetic access$0(Ljava/lang/StringBuilder;)V
    .locals 0
    .parameter

    .prologue
    .line 262
    sput-object p0, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    return-void
.end method

.method static synthetic access$1()Ljava/lang/StringBuilder;
    .locals 1

    .prologue
    .line 262
    sget-object v0, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    return-object v0
.end method

.method public static autoClearCache()V
    .locals 3

    .prologue
    .line 471
    new-instance v1, Ljava/io/File;

    sget-object v2, Lcom/netease/newsreader/util/FileUtils;->FileTempDir:Ljava/lang/String;

    invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 472
    .local v1, temppath:Ljava/io/File;
    invoke-static {v1}, Lcom/netease/newsreader/util/FileUtils;->excuteClear(Ljava/io/File;)V

    .line 473
    new-instance v0, Ljava/io/File;

    sget-object v2, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    invoke-direct {v0, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 474
    .local v0, detailpagepath:Ljava/io/File;
    invoke-static {v0}, Lcom/netease/newsreader/util/FileUtils;->excuteClear(Ljava/io/File;)V

    .line 476
    return-void
.end method

.method public static autoDeleteCacheFile(Ljava/io/File;J)Z
    .locals 9
    .parameter "file"
    .parameter "expiredDuration"

    .prologue
    const/4 v3, 0x1

    const/4 v4, 0x0

    .line 134
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v5

    if-eqz v5, :cond_3

    .line 135
    invoke-virtual {p0}, Ljava/io/File;->exists()Z

    move-result v5

    if-eqz v5, :cond_0

    invoke-virtual {p0}, Ljava/io/File;->isDirectory()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 137
    :try_start_0
    invoke-virtual {p0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v1

    .line 138
    .local v1, files:[Ljava/io/File;
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    if-eqz v1, :cond_0

    array-length v5, v1

    if-lt v2, v5, :cond_1

    .line 153
    .end local v1           #files:[Ljava/io/File;
    .end local v2           #i:I
    :cond_0
    :goto_1
    return v3

    .line 139
    .restart local v1       #files:[Ljava/io/File;
    .restart local v2       #i:I
    :cond_1
    aget-object v5, v1, v2

    invoke-virtual {v5}, Ljava/io/File;->isFile()Z

    move-result v5

    if-eqz v5, :cond_2

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v5

    aget-object v7, v1, v2

    invoke-virtual {v7}, Ljava/io/File;->lastModified()J

    move-result-wide v7

    sub-long/2addr v5, v7

    .line 140
    cmp-long v5, v5, p1

    if-ltz v5, :cond_2

    .line 141
    aget-object v5, v1, v2

    invoke-virtual {v5}, Ljava/io/File;->delete()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 138
    :cond_2
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 144
    .end local v1           #files:[Ljava/io/File;
    .end local v2           #i:I
    :catch_0
    move-exception v0

    .line 146
    .local v0, e:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    move v3, v4

    .line 147
    goto :goto_1

    .end local v0           #e:Ljava/lang/Exception;
    :cond_3
    move v3, v4

    .line 153
    goto :goto_1
.end method

.method public static clearCache(Landroid/content/Context;)V
    .locals 2
    .parameter "context"

    .prologue
    .line 463
    invoke-virtual {p0}, Landroid/content/Context;->getCacheDir()Ljava/io/File;

    move-result-object v1

    invoke-static {v1}, Lcom/netease/newsreader/util/FileUtils;->clearCacheFolder(Ljava/io/File;)I

    move-result v0

    .line 464
    .local v0, numDeletedFiles:I
    const-string v1, "webview.db"

    invoke-virtual {p0, v1}, Landroid/content/Context;->deleteDatabase(Ljava/lang/String;)Z

    .line 465
    const-string v1, "webviewCache.db"

    invoke-virtual {p0, v1}, Landroid/content/Context;->deleteDatabase(Ljava/lang/String;)Z

    .line 467
    return-void
.end method

.method public static clearCacheFolder(Ljava/io/File;)I
    .locals 7
    .parameter "dir"

    .prologue
    .line 431
    const/4 v1, 0x0

    .line 432
    .local v1, deletedFiles:I
    if-eqz p0, :cond_0

    invoke-virtual {p0}, Ljava/io/File;->isDirectory()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-virtual {p0}, Ljava/io/File;->exists()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 434
    :try_start_0
    invoke-virtual {p0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v3

    array-length v4, v3

    const/4 v2, 0x0

    :goto_0
    if-lt v2, v4, :cond_1

    .line 454
    :cond_0
    :goto_1
    return v1

    .line 434
    :cond_1
    aget-object v0, v3, v2

    .line 436
    .local v0, child:Ljava/io/File;
    invoke-virtual {v0}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v5

    const-string v6, "webviewcache"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_3

    .line 438
    invoke-virtual {v0}, Ljava/io/File;->isDirectory()Z

    move-result v5

    if-eqz v5, :cond_2

    .line 439
    invoke-static {v0}, Lcom/netease/newsreader/util/FileUtils;->clearCacheFolder(Ljava/io/File;)I

    move-result v5

    add-int/2addr v1, v5

    .line 442
    :cond_2
    invoke-virtual {v0}, Ljava/io/File;->delete()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v5

    if-eqz v5, :cond_3

    .line 443
    add-int/lit8 v1, v1, 0x1

    .line 434
    :cond_3
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 450
    .end local v0           #child:Ljava/io/File;
    :catch_0
    move-exception v2

    goto :goto_1
.end method

.method private static clearFile(Ljava/io/File;J)V
    .locals 8
    .parameter "file"
    .parameter "currentdate"

    .prologue
    .line 496
    if-eqz p0, :cond_0

    invoke-virtual {p0}, Ljava/io/File;->exists()Z

    move-result v4

    if-eqz v4, :cond_0

    invoke-virtual {p0}, Ljava/io/File;->isFile()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 497
    invoke-virtual {p0}, Ljava/io/File;->lastModified()J

    move-result-wide v2

    .line 498
    .local v2, filetime:J
    sub-long v4, p1, v2

    const-wide/32 v6, 0x5265c00

    div-long v0, v4, v6

    .line 499
    .local v0, expire:J
    sget-wide v4, Lcom/netease/newsreader/util/FileUtils;->EXPIRE:J

    cmp-long v4, v0, v4

    if-lez v4, :cond_0

    .line 500
    invoke-virtual {p0}, Ljava/io/File;->deleteOnExit()V

    .line 504
    .end local v0           #expire:J
    .end local v2           #filetime:J
    :cond_0
    return-void
.end method

.method public static createFile(Ljava/lang/String;)Z
    .locals 4
    .parameter "filepath"

    .prologue
    const/4 v2, 0x0

    .line 159
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 162
    .local v1, file:Ljava/io/File;
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v3

    if-nez v3, :cond_0

    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMountedReadOnly()Z

    move-result v3

    if-eqz v3, :cond_2

    :cond_0
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v3

    if-eqz v3, :cond_2

    .line 163
    const/4 v2, 0x1

    .line 172
    :cond_1
    :goto_0
    return v2

    .line 166
    :cond_2
    :try_start_0
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v3

    if-eqz v3, :cond_1

    .line 167
    invoke-virtual {v1}, Ljava/io/File;->createNewFile()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v2

    goto :goto_0

    .line 170
    :catch_0
    move-exception v0

    .line 172
    .local v0, e:Ljava/lang/Exception;
    goto :goto_0
.end method

.method public static createFolder(Ljava/lang/String;)Z
    .locals 2
    .parameter "filepath"

    .prologue
    .line 179
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 181
    .local v0, file:Ljava/io/File;
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v1

    if-nez v1, :cond_0

    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMountedReadOnly()Z

    move-result v1

    if-eqz v1, :cond_1

    :cond_0
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 182
    const/4 v1, 0x1

    .line 186
    :goto_0
    return v1

    .line 184
    :cond_1
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 185
    invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z

    move-result v1

    goto :goto_0

    .line 186
    :cond_2
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public static delDetailPageData(Ljava/lang/String;)V
    .locals 3
    .parameter "id"

    .prologue
    .line 425
    new-instance v1, Ljava/lang/StringBuilder;

    sget-object v2, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 426
    .local v0, filepath:Ljava/lang/String;
    invoke-static {v0}, Lcom/netease/newsreader/util/FileUtils;->delFile(Ljava/lang/String;)V

    .line 427
    return-void
.end method

.method public static delFile(Ljava/lang/String;)V
    .locals 2
    .parameter "strFileName"

    .prologue
    .line 192
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 194
    :try_start_0
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 195
    .local v0, myFile:Ljava/io/File;
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 196
    invoke-virtual {v0}, Ljava/io/File;->delete()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 202
    .end local v0           #myFile:Ljava/io/File;
    :cond_0
    :goto_0
    return-void

    .line 198
    :catch_0
    move-exception v1

    goto :goto_0
.end method

.method public static deleteFile(Ljava/io/File;)Z
    .locals 6
    .parameter "file"

    .prologue
    const/4 v3, 0x1

    const/4 v4, 0x0

    .line 107
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v5

    if-eqz v5, :cond_3

    .line 108
    invoke-virtual {p0}, Ljava/io/File;->exists()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 110
    :try_start_0
    invoke-virtual {p0}, Ljava/io/File;->isFile()Z

    move-result v5

    if-eqz v5, :cond_1

    .line 111
    invoke-virtual {p0}, Ljava/io/File;->delete()Z

    .line 129
    :cond_0
    :goto_0
    return v3

    .line 112
    :cond_1
    invoke-virtual {p0}, Ljava/io/File;->isDirectory()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 113
    invoke-virtual {p0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v1

    .line 114
    .local v1, files:[Ljava/io/File;
    const/4 v2, 0x0

    .local v2, i:I
    :goto_1
    array-length v5, v1

    if-lt v2, v5, :cond_2

    .line 117
    invoke-virtual {p0}, Ljava/io/File;->delete()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 120
    .end local v1           #files:[Ljava/io/File;
    .end local v2           #i:I
    :catch_0
    move-exception v0

    .line 122
    .local v0, e:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    move v3, v4

    .line 123
    goto :goto_0

    .line 115
    .end local v0           #e:Ljava/lang/Exception;
    .restart local v1       #files:[Ljava/io/File;
    .restart local v2       #i:I
    :cond_2
    :try_start_1
    aget-object v5, v1, v2

    invoke-static {v5}, Lcom/netease/newsreader/util/FileUtils;->deleteFile(Ljava/io/File;)Z
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 114
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    .end local v1           #files:[Ljava/io/File;
    .end local v2           #i:I
    :cond_3
    move v3, v4

    .line 129
    goto :goto_0
.end method

.method private static excuteClear(Ljava/io/File;)V
    .locals 7
    .parameter "path"

    .prologue
    .line 480
    invoke-virtual {p0}, Ljava/io/File;->exists()Z

    move-result v6

    if-eqz v6, :cond_0

    invoke-virtual {p0}, Ljava/io/File;->isDirectory()Z

    move-result v6

    if-eqz v6, :cond_0

    .line 481
    new-instance v6, Ljava/util/Date;

    invoke-direct {v6}, Ljava/util/Date;-><init>()V

    invoke-virtual {v6}, Ljava/util/Date;->getTime()J

    move-result-wide v0

    .line 482
    .local v0, currentdate:J
    invoke-virtual {p0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v2

    .line 483
    .local v2, files:[Ljava/io/File;
    if-eqz v2, :cond_0

    .line 484
    array-length v4, v2

    .line 485
    .local v4, length:I
    const/4 v3, 0x0

    .local v3, index:I
    :goto_0
    if-lt v3, v4, :cond_1

    .line 492
    .end local v0           #currentdate:J
    .end local v2           #files:[Ljava/io/File;
    .end local v3           #index:I
    .end local v4           #length:I
    :cond_0
    return-void

    .line 486
    .restart local v0       #currentdate:J
    .restart local v2       #files:[Ljava/io/File;
    .restart local v3       #index:I
    .restart local v4       #length:I
    :cond_1
    aget-object v5, v2, v3

    .line 487
    .local v5, one:Ljava/io/File;
    invoke-static {v5, v0, v1}, Lcom/netease/newsreader/util/FileUtils;->clearFile(Ljava/io/File;J)V

    .line 485
    add-int/lit8 v3, v3, 0x1

    goto :goto_0
.end method

.method public static getFileSize(Ljava/io/File;)J
    .locals 8
    .parameter "f"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 43
    const-wide/16 v2, 0x0

    .line 44
    .local v2, size:J
    invoke-virtual {p0}, Ljava/io/File;->exists()Z

    move-result v6

    if-nez v6, :cond_0

    move-wide v4, v2

    .line 56
    .end local v2           #size:J
    .local v4, size:J
    :goto_0
    return-wide v4

    .line 45
    .end local v4           #size:J
    .restart local v2       #size:J
    :cond_0
    invoke-virtual {p0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v0

    .line 46
    .local v0, flist:[Ljava/io/File;
    const/4 v1, 0x0

    .local v1, i:I
    :goto_1
    array-length v6, v0

    if-lt v1, v6, :cond_1

    move-wide v4, v2

    .line 56
    .end local v2           #size:J
    .restart local v4       #size:J
    goto :goto_0

    .line 48
    .end local v4           #size:J
    .restart local v2       #size:J
    :cond_1
    aget-object v6, v0, v1

    invoke-virtual {v6}, Ljava/io/File;->isDirectory()Z

    move-result v6

    if-eqz v6, :cond_2

    .line 50
    aget-object v6, v0, v1

    invoke-static {v6}, Lcom/netease/newsreader/util/FileUtils;->getFileSize(Ljava/io/File;)J

    move-result-wide v6

    add-long/2addr v2, v6

    .line 46
    :goto_2
    add-int/lit8 v1, v1, 0x1

    goto :goto_1

    .line 53
    :cond_2
    aget-object v6, v0, v1

    invoke-virtual {v6}, Ljava/io/File;->length()J

    move-result-wide v6

    add-long/2addr v2, v6

    goto :goto_2
.end method

.method public static getFileSizes(Ljava/io/File;)J
    .locals 4
    .parameter "f"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 29
    const-wide/16 v1, 0x0

    .line 30
    .local v1, s:J
    invoke-virtual {p0}, Ljava/io/File;->exists()Z

    move-result v3

    if-eqz v3, :cond_0

    .line 31
    const/4 v0, 0x0

    .line 32
    .local v0, fis:Ljava/io/FileInputStream;
    new-instance v0, Ljava/io/FileInputStream;

    .end local v0           #fis:Ljava/io/FileInputStream;
    invoke-direct {v0, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    .line 33
    .restart local v0       #fis:Ljava/io/FileInputStream;
    invoke-virtual {v0}, Ljava/io/FileInputStream;->available()I

    move-result v3

    int-to-long v1, v3

    .line 38
    .end local v0           #fis:Ljava/io/FileInputStream;
    :goto_0
    return-wide v1

    .line 35
    :cond_0
    invoke-virtual {p0}, Ljava/io/File;->createNewFile()Z

    goto :goto_0
.end method

.method public static isFileExit(Ljava/lang/String;)Z
    .locals 3
    .parameter "filename"

    .prologue
    .line 93
    const/4 v2, 0x0

    .line 96
    .local v2, s:Z
    :try_start_0
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 97
    .local v1, file:Ljava/io/File;
    invoke-virtual {v1}, Ljava/io/File;->exists()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v2

    .line 103
    .end local v1           #file:Ljava/io/File;
    :goto_0
    return v2

    .line 98
    :catch_0
    move-exception v0

    .line 100
    .local v0, e:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method public static isSDCardMounted()Z
    .locals 2

    .prologue
    .line 75
    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    .line 76
    .local v0, sDStateString:Ljava/lang/String;
    const-string v1, "mounted"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 77
    const/4 v1, 0x1

    .line 79
    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public static isSDCardMountedReadOnly()Z
    .locals 2

    .prologue
    .line 84
    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    .line 85
    .local v0, sDStateString:Ljava/lang/String;
    const-string v1, "mounted_ro"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 86
    const/4 v1, 0x1

    .line 88
    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public static readDetailPageData(Ljava/lang/String;)Ljava/util/HashMap;
    .locals 8
    .parameter "id"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v5, 0x0

    .line 205
    new-instance v6, Ljava/lang/StringBuilder;

    sget-object v7, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    .line 206
    .local v4, filepath:Ljava/lang/String;
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v6

    if-nez v6, :cond_0

    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMountedReadOnly()Z

    move-result v6

    if-eqz v6, :cond_1

    .line 207
    :cond_0
    invoke-static {v4}, Lcom/netease/newsreader/util/FileUtils;->isFileExit(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_1

    .line 209
    :try_start_0
    new-instance v3, Ljava/io/FileInputStream;

    invoke-direct {v3, v4}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V

    .line 210
    .local v3, fi:Ljava/io/FileInputStream;
    new-instance v1, Ljava/io/ObjectInputStream;

    invoke-direct {v1, v3}, Ljava/io/ObjectInputStream;-><init>(Ljava/io/InputStream;)V

    .line 212
    .local v1, dataI:Ljava/io/ObjectInputStream;
    invoke-virtual {v1}, Ljava/io/ObjectInputStream;->readObject()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/bean/DetailPageBean;

    .line 214
    .local v0, bean:Lcom/netease/newsreader/bean/DetailPageBean;
    if-eqz v0, :cond_1

    .line 216
    invoke-virtual {v0}, Lcom/netease/newsreader/bean/DetailPageBean;->getData()Ljava/util/HashMap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v5

    .line 229
    .end local v0           #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .end local v1           #dataI:Ljava/io/ObjectInputStream;
    .end local v3           #fi:Ljava/io/FileInputStream;
    :cond_1
    :goto_0
    return-object v5

    .line 222
    :catch_0
    move-exception v2

    .line 223
    .local v2, e:Ljava/lang/Exception;
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method public static writeDetailPageData(Ljava/util/HashMap;Ljava/lang/String;)V
    .locals 6
    .parameter
    .parameter "id"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;",
            "Ljava/lang/String;",
            ")V"
        }
    .end annotation

    .prologue
    .line 235
    .local p0, data:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    new-instance v4, Ljava/lang/StringBuilder;

    sget-object v5, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 236
    .local v2, filepath:Ljava/lang/String;
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 238
    :try_start_0
    invoke-static {v2}, Lcom/netease/newsreader/util/FileUtils;->delFile(Ljava/lang/String;)V

    .line 239
    invoke-static {v2}, Lcom/netease/newsreader/util/FileUtils;->isFileExit(Ljava/lang/String;)Z

    move-result v4

    if-nez v4, :cond_0

    if-eqz p0, :cond_0

    invoke-virtual {p0}, Ljava/util/HashMap;->isEmpty()Z

    move-result v4

    if-nez v4, :cond_0

    .line 240
    sget-object v4, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    invoke-static {v4}, Lcom/netease/newsreader/util/FileUtils;->createFolder(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 242
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V

    .line 243
    .local v3, fo:Ljava/io/FileOutputStream;
    new-instance v1, Ljava/io/ObjectOutputStream;

    invoke-direct {v1, v3}, Ljava/io/ObjectOutputStream;-><init>(Ljava/io/OutputStream;)V

    .line 245
    .local v1, dataO:Ljava/io/ObjectOutputStream;
    new-instance v0, Lcom/netease/newsreader/bean/DetailPageBean;

    invoke-direct {v0}, Lcom/netease/newsreader/bean/DetailPageBean;-><init>()V

    .line 247
    .local v0, bean:Lcom/netease/newsreader/bean/DetailPageBean;
    invoke-virtual {v0, p0}, Lcom/netease/newsreader/bean/DetailPageBean;->setData(Ljava/util/HashMap;)V

    .line 249
    invoke-virtual {v1, v0}, Ljava/io/ObjectOutputStream;->writeObject(Ljava/lang/Object;)V

    .line 251
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->close()V
    :try_end_0
    .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 260
    .end local v0           #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .end local v1           #dataO:Ljava/io/ObjectOutputStream;
    .end local v3           #fo:Ljava/io/FileOutputStream;
    :cond_0
    :goto_0
    return-void

    .line 256
    :catch_0
    move-exception v4

    goto :goto_0

    .line 254
    :catch_1
    move-exception v4

    goto :goto_0
.end method

.method public static writeDetailPageData4Offline(Ljava/util/HashMap;Ljava/lang/String;Landroid/content/Context;Ljava/lang/String;)V
    .locals 18
    .parameter
    .parameter "id"
    .parameter "mContext"
    .parameter "columnid"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;",
            "Ljava/lang/String;",
            "Landroid/content/Context;",
            "Ljava/lang/String;",
            ")V"
        }
    .end annotation

    .prologue
    .line 328
    .local p0, data:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    new-instance v15, Ljava/lang/StringBuilder;

    sget-object v16, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    invoke-static/range {v16 .. v16}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v16

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, p1

    invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    .line 329
    .local v5, filepath:Ljava/lang/String;
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v15

    if-eqz v15, :cond_0

    .line 331
    :try_start_0
    invoke-static {v5}, Lcom/netease/newsreader/util/FileUtils;->isFileExit(Ljava/lang/String;)Z

    move-result v15

    if-nez v15, :cond_0

    if-eqz p0, :cond_0

    invoke-virtual/range {p0 .. p0}, Ljava/util/HashMap;->isEmpty()Z

    move-result v15

    if-nez v15, :cond_0

    .line 332
    sget-object v15, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    invoke-static {v15}, Lcom/netease/newsreader/util/FileUtils;->createFolder(Ljava/lang/String;)Z

    move-result v15

    if-eqz v15, :cond_0

    .line 334
    new-instance v6, Ljava/io/FileOutputStream;

    invoke-direct {v6, v5}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V

    .line 335
    .local v6, fo:Ljava/io/FileOutputStream;
    new-instance v3, Ljava/io/ObjectOutputStream;

    invoke-direct {v3, v6}, Ljava/io/ObjectOutputStream;-><init>(Ljava/io/OutputStream;)V

    .line 337
    .local v3, dataO:Ljava/io/ObjectOutputStream;
    new-instance v1, Lcom/netease/newsreader/bean/DetailPageBean;

    invoke-direct {v1}, Lcom/netease/newsreader/bean/DetailPageBean;-><init>()V

    .line 339
    .local v1, bean:Lcom/netease/newsreader/bean/DetailPageBean;
    move-object/from16 v0, p0

    invoke-virtual {v1, v0}, Lcom/netease/newsreader/bean/DetailPageBean;->setData(Ljava/util/HashMap;)V

    .line 341
    invoke-virtual {v3, v1}, Ljava/io/ObjectOutputStream;->writeObject(Ljava/lang/Object;)V

    .line 342
    invoke-virtual {v3}, Ljava/io/ObjectOutputStream;->flush()V

    .line 343
    invoke-virtual {v3}, Ljava/io/ObjectOutputStream;->close()V

    .line 344
    invoke-virtual {v6}, Ljava/io/FileOutputStream;->close()V

    .line 346
    const-string v15, "img"

    move-object/from16 v0, p0

    invoke-virtual {v0, v15}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v15

    if-eqz v15, :cond_0

    .line 347
    const-string v15, "img"

    move-object/from16 v0, p0

    invoke-virtual {v0, v15}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Ljava/util/ArrayList;

    .line 358
    .local v9, imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    invoke-interface {v9}, Ljava/util/List;->size()I

    move-result v12

    .line 359
    .local v12, length:I
    const/4 v8, 0x0

    .local v8, i:I
    :goto_0
    if-lt v8, v12, :cond_1

    .line 408
    invoke-interface {v9}, Ljava/util/List;->clear()V

    .line 422
    .end local v1           #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .end local v3           #dataO:Ljava/io/ObjectOutputStream;
    .end local v6           #fo:Ljava/io/FileOutputStream;
    .end local v8           #i:I
    .end local v9           #imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .end local v12           #length:I
    :cond_0
    :goto_1
    return-void

    .line 360
    .restart local v1       #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .restart local v3       #dataO:Ljava/io/ObjectOutputStream;
    .restart local v6       #fo:Ljava/io/FileOutputStream;
    .restart local v8       #i:I
    .restart local v9       #imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .restart local v12       #length:I
    :cond_1
    invoke-interface {v9, v8}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/util/HashMap;

    .line 361
    .local v10, imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    new-instance v15, Ljava/lang/StringBuilder;

    new-instance v16, Ljava/lang/StringBuilder;

    invoke-direct/range {v16 .. v16}, Ljava/lang/StringBuilder;-><init>()V

    const-string v17, "src"

    move-object/from16 v0, v17

    invoke-virtual {v10, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v17

    invoke-virtual/range {v16 .. v17}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v16

    invoke-virtual/range {v16 .. v16}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v16

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    sput-object v15, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    .line 365
    sget-object v15, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    const-string v16, "http://"

    invoke-virtual/range {v16 .. v16}, Ljava/lang/String;->length()I

    move-result v16

    const-string v17, "s.cimg.163.com/i/"

    invoke-virtual/range {v15 .. v17}, Ljava/lang/StringBuilder;->insert(ILjava/lang/String;)Ljava/lang/StringBuilder;

    .line 366
    const/4 v15, 0x1

    invoke-static/range {p2 .. p2}, Lcom/netease/newsreader/util/Tools;->getScreenMetrics(Landroid/content/Context;)I

    move-result v16

    move/from16 v0, v16

    if-ne v15, v0, :cond_4

    .line 367
    sget-object v15, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    const-string v16, ".180x300.auto_small.jpg"

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    :try_end_0
    .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 375
    :goto_2
    :try_start_1
    sget-object v15, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    sget-object v16, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    .line 376
    const-string v17, "/"

    invoke-virtual/range {v16 .. v17}, Ljava/lang/StringBuilder;->lastIndexOf(Ljava/lang/String;)I

    move-result v16

    add-int/lit8 v16, v16, 0x1

    sget-object v17, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    invoke-virtual/range {v17 .. v17}, Ljava/lang/StringBuilder;->length()I

    move-result v17

    .line 375
    invoke-virtual/range {v15 .. v17}, Ljava/lang/StringBuilder;->substring(II)Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v15

    if-nez v15, :cond_3

    .line 378
    sget-object v15, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    .line 380
    .local v11, imgUrl:Ljava/lang/String;
    const-string v15, "_small"

    const-string v16, ""

    move-object/from16 v0, v16

    invoke-virtual {v11, v15, v0}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v15

    move-object/from16 v0, p2

    invoke-static {v15, v0}, Lcom/netease/newsreader/util/PicUtil;->downloadImgToLocal(Ljava/lang/String;Landroid/content/Context;)Z

    move-result v15

    if-eqz v15, :cond_3

    .line 381
    const-string v15, "/"

    invoke-virtual {v11, v15}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v15

    add-int/lit8 v15, v15, 0x1

    invoke-virtual {v11}, Ljava/lang/String;->length()I

    move-result v16

    move/from16 v0, v16

    invoke-virtual {v11, v15, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v15

    const-string v16, "_small"

    const-string v17, ""

    invoke-virtual/range {v15 .. v17}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/netease/newsreader/util/PicUtil;->readTempJPEGFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v2

    .line 382
    .local v2, bm:Landroid/graphics/Bitmap;
    invoke-virtual {v2}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v14

    .line 383
    .local v14, w:I
    invoke-virtual {v2}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v7

    .line 384
    .local v7, h:I
    const/16 v13, 0x82

    .line 385
    .local v13, picSize:I
    invoke-static {v14, v7}, Ljava/lang/Math;->min(II)I

    move-result v15

    if-le v15, v13, :cond_2

    .line 387
    if-le v14, v7, :cond_6

    .line 388
    int-to-float v15, v13

    int-to-float v0, v14

    move/from16 v16, v0

    int-to-float v0, v7

    move/from16 v17, v0

    div-float v16, v16, v17

    mul-float v15, v15, v16

    float-to-int v14, v15

    .line 389
    move v7, v13

    .line 394
    :goto_3
    move-object/from16 v0, p2

    invoke-static {v0, v2, v14, v7}, Lcom/netease/newsreader/util/PicUtil;->resizeBitmap(Landroid/content/Context;Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v2

    .line 396
    :cond_2
    if-eqz v2, :cond_3

    .line 397
    const-string v15, "/"

    invoke-virtual {v11, v15}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v15

    add-int/lit8 v15, v15, 0x1

    invoke-virtual {v11}, Ljava/lang/String;->length()I

    move-result v16

    move/from16 v0, v16

    invoke-virtual {v11, v15, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v15

    invoke-static {v15, v2}, Lcom/netease/newsreader/util/PicUtil;->saveMyBitmap(Ljava/lang/String;Landroid/graphics/Bitmap;)Z

    .line 398
    invoke-virtual {v2}, Landroid/graphics/Bitmap;->recycle()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2
    .catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_0

    .line 359
    .end local v2           #bm:Landroid/graphics/Bitmap;
    .end local v7           #h:I
    .end local v11           #imgUrl:Ljava/lang/String;
    .end local v13           #picSize:I
    .end local v14           #w:I
    :cond_3
    :goto_4
    add-int/lit8 v8, v8, 0x1

    goto/16 :goto_0

    .line 368
    :cond_4
    const/4 v15, 0x2

    :try_start_2
    invoke-static/range {p2 .. p2}, Lcom/netease/newsreader/util/Tools;->getScreenMetrics(Landroid/content/Context;)I

    move-result v16

    move/from16 v0, v16

    if-ne v15, v0, :cond_5

    .line 369
    sget-object v15, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    const-string v16, ".220x370.auto_small.jpg"

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    :try_end_2
    .catch Ljava/io/FileNotFoundException; {:try_start_2 .. :try_end_2} :catch_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    goto/16 :goto_2

    .line 413
    .end local v1           #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .end local v3           #dataO:Ljava/io/ObjectOutputStream;
    .end local v6           #fo:Ljava/io/FileOutputStream;
    .end local v8           #i:I
    .end local v9           #imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .end local v10           #imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .end local v12           #length:I
    :catch_0
    move-exception v4

    .line 415
    .local v4, e:Ljava/io/FileNotFoundException;
    invoke-virtual {v4}, Ljava/io/FileNotFoundException;->printStackTrace()V

    goto/16 :goto_1

    .line 371
    .end local v4           #e:Ljava/io/FileNotFoundException;
    .restart local v1       #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .restart local v3       #dataO:Ljava/io/ObjectOutputStream;
    .restart local v6       #fo:Ljava/io/FileOutputStream;
    .restart local v8       #i:I
    .restart local v9       #imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .restart local v10       #imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .restart local v12       #length:I
    :cond_5
    :try_start_3
    sget-object v15, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    const-string v16, ".420x740.auto_small.jpg"

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    :try_end_3
    .catch Ljava/io/FileNotFoundException; {:try_start_3 .. :try_end_3} :catch_0
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1

    goto/16 :goto_2

    .line 416
    .end local v1           #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .end local v3           #dataO:Ljava/io/ObjectOutputStream;
    .end local v6           #fo:Ljava/io/FileOutputStream;
    .end local v8           #i:I
    .end local v9           #imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .end local v10           #imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .end local v12           #length:I
    :catch_1
    move-exception v4

    .line 418
    .local v4, e:Ljava/lang/Exception;
    invoke-virtual {v4}, Ljava/lang/Exception;->printStackTrace()V

    goto/16 :goto_1

    .line 391
    .end local v4           #e:Ljava/lang/Exception;
    .restart local v1       #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .restart local v2       #bm:Landroid/graphics/Bitmap;
    .restart local v3       #dataO:Ljava/io/ObjectOutputStream;
    .restart local v6       #fo:Ljava/io/FileOutputStream;
    .restart local v7       #h:I
    .restart local v8       #i:I
    .restart local v9       #imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .restart local v10       #imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .restart local v11       #imgUrl:Ljava/lang/String;
    .restart local v12       #length:I
    .restart local v13       #picSize:I
    .restart local v14       #w:I
    :cond_6
    int-to-float v15, v13

    int-to-float v0, v7

    move/from16 v16, v0

    int-to-float v0, v14

    move/from16 v17, v0

    div-float v16, v16, v17

    mul-float v15, v15, v16

    float-to-int v7, v15

    .line 392
    move v14, v13

    goto :goto_3

    .line 403
    .end local v2           #bm:Landroid/graphics/Bitmap;
    .end local v7           #h:I
    .end local v11           #imgUrl:Ljava/lang/String;
    .end local v13           #picSize:I
    .end local v14           #w:I
    :catch_2
    move-exception v4

    .line 405
    .restart local v4       #e:Ljava/lang/Exception;
    :try_start_4
    invoke-virtual {v4}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_4
    .catch Ljava/io/FileNotFoundException; {:try_start_4 .. :try_end_4} :catch_0
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_1

    goto :goto_4
.end method

.method public static writeDetailPageData4OfflineThread(Ljava/util/HashMap;Ljava/lang/String;Landroid/content/Context;Ljava/lang/String;)V
    .locals 16
    .parameter
    .parameter "id"
    .parameter "mContext"
    .parameter "columnid"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;",
            "Ljava/lang/String;",
            "Landroid/content/Context;",
            "Ljava/lang/String;",
            ")V"
        }
    .end annotation

    .prologue
    .line 264
    .local p0, data:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    new-instance v13, Ljava/lang/StringBuilder;

    sget-object v14, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    invoke-static {v14}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v14

    invoke-direct {v13, v14}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, p1

    invoke-virtual {v13, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v13

    invoke-virtual {v13}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    .line 265
    .local v5, filepath:Ljava/lang/String;
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v13

    if-eqz v13, :cond_0

    .line 267
    :try_start_0
    invoke-static {v5}, Lcom/netease/newsreader/util/FileUtils;->isFileExit(Ljava/lang/String;)Z

    move-result v13

    if-nez v13, :cond_0

    if-eqz p0, :cond_0

    invoke-virtual/range {p0 .. p0}, Ljava/util/HashMap;->isEmpty()Z

    move-result v13

    if-nez v13, :cond_0

    .line 268
    sget-object v13, Lcom/netease/newsreader/util/FileUtils;->DetailPageTempDir:Ljava/lang/String;

    invoke-static {v13}, Lcom/netease/newsreader/util/FileUtils;->createFolder(Ljava/lang/String;)Z

    move-result v13

    if-eqz v13, :cond_0

    .line 270
    new-instance v6, Ljava/io/FileOutputStream;

    invoke-direct {v6, v5}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V

    .line 271
    .local v6, fo:Ljava/io/FileOutputStream;
    new-instance v3, Ljava/io/ObjectOutputStream;

    invoke-direct {v3, v6}, Ljava/io/ObjectOutputStream;-><init>(Ljava/io/OutputStream;)V

    .line 273
    .local v3, dataO:Ljava/io/ObjectOutputStream;
    new-instance v2, Lcom/netease/newsreader/bean/DetailPageBean;

    invoke-direct {v2}, Lcom/netease/newsreader/bean/DetailPageBean;-><init>()V

    .line 275
    .local v2, bean:Lcom/netease/newsreader/bean/DetailPageBean;
    move-object/from16 v0, p0

    invoke-virtual {v2, v0}, Lcom/netease/newsreader/bean/DetailPageBean;->setData(Ljava/util/HashMap;)V

    .line 277
    invoke-virtual {v3, v2}, Ljava/io/ObjectOutputStream;->writeObject(Ljava/lang/Object;)V

    .line 279
    invoke-virtual {v6}, Ljava/io/FileOutputStream;->close()V

    .line 281
    const-string v13, "img"

    move-object/from16 v0, p0

    invoke-virtual {v0, v13}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v13

    if-eqz v13, :cond_0

    .line 282
    const-string v13, "img"

    move-object/from16 v0, p0

    invoke-virtual {v0, v13}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Ljava/util/ArrayList;

    .line 283
    .local v8, imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    new-instance v9, Ljava/util/HashMap;

    invoke-direct {v9}, Ljava/util/HashMap;-><init>()V

    .line 284
    .local v9, imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    invoke-interface {v8}, Ljava/util/List;->size()I

    move-result v12

    .line 285
    .local v12, length:I
    const/4 v7, 0x0

    .local v7, i:I
    :goto_0
    if-lt v7, v12, :cond_1

    .line 311
    invoke-interface {v8}, Ljava/util/List;->clear()V

    .line 324
    .end local v2           #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .end local v3           #dataO:Ljava/io/ObjectOutputStream;
    .end local v6           #fo:Ljava/io/FileOutputStream;
    .end local v7           #i:I
    .end local v8           #imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .end local v9           #imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .end local v12           #length:I
    :cond_0
    :goto_1
    return-void

    .line 286
    .restart local v2       #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .restart local v3       #dataO:Ljava/io/ObjectOutputStream;
    .restart local v6       #fo:Ljava/io/FileOutputStream;
    .restart local v7       #i:I
    .restart local v8       #imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .restart local v9       #imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .restart local v12       #length:I
    :cond_1
    invoke-interface {v8, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v9

    .end local v9           #imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    check-cast v9, Ljava/util/HashMap;

    .line 287
    .restart local v9       #imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    new-instance v13, Ljava/lang/StringBuilder;

    new-instance v14, Ljava/lang/StringBuilder;

    invoke-direct {v14}, Ljava/lang/StringBuilder;-><init>()V

    const-string v15, "src"

    invoke-virtual {v9, v15}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v15

    invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v14

    invoke-virtual {v14}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v14

    invoke-direct {v13, v14}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    sput-object v13, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    .line 288
    sget-object v13, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    const-string v14, "http://"

    invoke-virtual {v14}, Ljava/lang/String;->length()I

    move-result v14

    const-string v15, "s.cimg.163.com/i/"

    invoke-virtual {v13, v14, v15}, Ljava/lang/StringBuilder;->insert(ILjava/lang/String;)Ljava/lang/StringBuilder;

    .line 289
    sget-object v13, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    const-string v14, ".220x220.auto.jpg"

    invoke-virtual {v13, v14}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 291
    sget-object v13, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    sget-object v14, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    .line 292
    const-string v15, "/"

    invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->lastIndexOf(Ljava/lang/String;)I

    move-result v14

    add-int/lit8 v14, v14, 0x1

    sget-object v15, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->length()I

    move-result v15

    .line 291
    invoke-virtual {v13, v14, v15}, Ljava/lang/StringBuilder;->substring(II)Ljava/lang/String;

    move-result-object v13

    invoke-static {v13}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v13

    if-nez v13, :cond_2

    .line 294
    sget-object v13, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    invoke-virtual {v13}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    .line 295
    .local v11, imgUrl:Ljava/lang/String;
    sget-object v13, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    sget-object v14, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    const-string v15, "/"

    invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->lastIndexOf(Ljava/lang/String;)I

    move-result v14

    add-int/lit8 v14, v14, 0x1

    sget-object v15, Lcom/netease/newsreader/util/FileUtils;->imgSrc:Ljava/lang/StringBuilder;

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->length()I

    move-result v15

    invoke-virtual {v13, v14, v15}, Ljava/lang/StringBuilder;->substring(II)Ljava/lang/String;

    move-result-object v10

    .line 296
    .local v10, imgName:Ljava/lang/String;
    move-object/from16 v1, p2

    .line 297
    .local v1, _context:Landroid/content/Context;
    new-instance v13, Lcom/netease/newsreader/util/FileUtils$1;

    invoke-direct {v13, v11, v1}, Lcom/netease/newsreader/util/FileUtils$1;-><init>(Ljava/lang/String;Landroid/content/Context;)V

    .line 308
    invoke-virtual {v13}, Lcom/netease/newsreader/util/FileUtils$1;->start()V
    :try_end_0
    .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 285
    .end local v1           #_context:Landroid/content/Context;
    .end local v10           #imgName:Ljava/lang/String;
    .end local v11           #imgUrl:Ljava/lang/String;
    :cond_2
    add-int/lit8 v7, v7, 0x1

    goto :goto_0

    .line 315
    .end local v2           #bean:Lcom/netease/newsreader/bean/DetailPageBean;
    .end local v3           #dataO:Ljava/io/ObjectOutputStream;
    .end local v6           #fo:Ljava/io/FileOutputStream;
    .end local v7           #i:I
    .end local v8           #imgList:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    .end local v9           #imgMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .end local v12           #length:I
    :catch_0
    move-exception v4

    .line 317
    .local v4, e:Ljava/io/FileNotFoundException;
    invoke-virtual {v4}, Ljava/io/FileNotFoundException;->printStackTrace()V

    goto :goto_1

    .line 318
    .end local v4           #e:Ljava/io/FileNotFoundException;
    :catch_1
    move-exception v4

    .line 320
    .local v4, e:Ljava/lang/Exception;
    invoke-virtual {v4}, Ljava/lang/Exception;->printStackTrace()V

    goto/16 :goto_1
.end method
